Skip to content

feat(graph): sort sibling nodes by reserved numeric order field - #274

Merged
mindsocket merged 1 commit into
mainfrom
feat/240-order-nodes-by-order-field
Nov 30, 2026
Merged

mindsocket merged 1 commit into
mainfrom
feat/240-order-nodes-by-order-field

Conversation

@mindsocket

Copy link
Copy Markdown
Owner

Closes #240

Summary

  • Sorts sibling collections in buildSpaceGraph (src/space-graph.ts) by a node's numeric schemaData.order ascending:
    • Applies to each parent's children (hierarchyChildren, children, childEdges) and top-level sibling lists (hierarchyRoots, orphans, nonHierarchy). graph.nodes continues to preserve insertion order.
    • Nodes without an order (or with non-numeric / non-finite values) sort at the end; ties preserve existing relative order.
    • A node with multiple parents uses its single order value under each parent.
  • Rebuilt plugin/hooks/projection.js (bun run build:mod-projection) and documented the convention in docs/concepts.md.
  • Added unit tests in tests/space-graph.test.ts.

Verification

  • bun test tests/space-graph.test.ts tests/space-graph-data.test.ts (31 pass, 0 fail)
  • sctx --config docs/.sctx/config.json validate-file docs/concepts.md (valid)
  • lefthook pre-push (check-plugin-version, pushed-tree full test + hook suites, review-check)

@claude

claude Bot commented Nov 30, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@mindsocket
mindsocket merged commit 18aaadb into main Nov 30, 2026
2 checks passed
@mindsocket
mindsocket deleted the feat/240-order-nodes-by-order-field branch November 30, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Order nodes by a reserved order field

1 participant